<!DOCTYPE html>
<html>
<head>
	<title>餐饮营销支持系统</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link href="../../css/bootstrap.min.css" rel="stylesheet">
	<!-- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> -->
	<link rel="stylesheet" type="text/css" href="../../css/waiter.css">
	<link rel="stylesheet" type="text/css" href="../../css/boss.css">
</head>
<body>
	<div id="head">
		<div class="navbar navbar-default  navbar-inverse" role="navigation">
			<div class="navbar-header">
				<a href="##" class="navbar-brand">餐饮营销支持系统</a>
			</div>
			<button type="submit" class="btn btn-danger">
				<span style="margin-right: 5px" class="glyphicon glyphicon-off"></span>注销
			</button>
		</div>
	</div>
	
	<div id="left">
		<p class="left-head">
			boss登录
		</p>
		<div class="container">
			<div class="row" style="margin-top: 0px">
				<a href="./boss.html">
					<div class="col-md-12">
						<span class="glyphicon glyphicon-user"></span>
						<p>个人信息</p>
					</div>
				</a>
			</div>
			<div class="row">
				<a href="./boss-two.html">
					<div class="col-md-12">
						<span class="glyphicon glyphicon-home"></span>
						<p>店铺管理</p>
					</div>
				</a>
			</div>
			<div class="row act">
				
				<div class="col-md-12">
					<span class="glyphicon glyphicon-plus-sign"></span>
					<p>店铺人员</p>
				</div>
			</div>
			<div class="row">
				<a href="./boss-four.html">
					<div class="col-md-12">
						<span class="glyphicon glyphicon-list"></span>
						<p>菜单管理</p>
					</div>
				</a>
			</div>
			<div class="row">
				<a href="./boss-five.html">
					<div class="col-md-12">
						<span class="glyphicon glyphicon-retweet"></span>
						<p>收益比例</p>
					</div>
				</a>
			</div>

			<div class="row">
				<a href="./boss-six.html">
					<div class="col-md-12">
						<span class="glyphicon glyphicon-th"></span>
						<p>收入查询</p>
					</div>
				</a>
			</div>
		</div>
	</div>

	<div id="right">
		<div class="right-head">
			<ol class="breadcrumb">
				<li><a href="#">首页</a></li>
				<li class="active">经理信息</li>
			</ol> 
		</div>
		<div class="con">
			<div class="container">
				<div class="row">
					<div class="col-md-12">
						<div class="panel panel-default">
							<div class="panel-body">
								<div class="row">
									<p class="from-top">
										店铺人员
									</p>
								</div>
								<div class="row">
									<label class="col-lg-3 control-label">
										选择地区：
									</label>
									<div class="col-lg-2">
										<select name="省" class="form-control" id = "provinces"> 
										</select>
									</div>
									<div class="col-lg-2">
										<select name="市" class="form-control" id = "citys"> 
										</select>
									</div>
									<div class="col-lg-2">
										<select name="县" class="form-control" id = "adress"> 
										</select>
									</div>
								</div>
								<div class="row">
									<label class="col-lg-3 control-label">
										选择店铺：
									</label>
									<div class="col-lg-6">
										<select name="店铺" class="form-control" id="storeselect">
										</select>
									</div>
								</div>

								<div class="row">
									<div class="col-lg-10 col-lg-offset-1">
										<div class="table-responsive">
											<table class="table table-striped table-bordered table-hover">
												<thead>
													<tr>
														<th>名称</th>
														<th>手机号</th>
														<th>身份证号</th>
														<th>店铺</th>
														<th>岗位</th>
														<!-- <th>修改</th> -->
													</tr>
												</thead>
												<tbody id="managers">
												</tbody>
											</table>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<script src="../../js/Jquary/jquery-3.2.1.min.js"></script>
	<script src="../../js/Jquary/jquery.easyui.min.js"></script>
	<script src="../../js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../../js/logout.js"></script>
	<script type="text/javascript" src="../../js/adress.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#adress").change(function(){
				getStoreByAdress();
			});
			$("#storeselect").change(function(){
				getManagerByStore();
			});
			$("#managers").on('click', '.manager',function(){
				var managerid = $(this).attr("name");
				alert(1)
			});
			
			getAdress();
			getStoreByAdress();
			getManagerByStore();
			
		})
	</script>
	<script type="text/javascript">
		function getStoreByAdress(){
			var adressid = $("#adress").val();
			if(adressid==-1||adressid==null){
				return;
			};
			$.ajax({
				type:"get",
				url:"/ldss/address/allstoreselect",
				data:{
					adressid:adressid
				},
				async:false,
				dataType:"json",
				success: function (data) {
					if(data.success){
						var data = data.data;
						$("#storeselect").empty();
						for(var i = 0; i < data.length; i++){
							 $("#storeselect").append("<option value='"+data[i].storeid+"'>"+data[i].storename+"</option>");
			            }
					}
					else{
						alert(data.message);
					}
				}
			})
		}
	
		function getManagerByStore(){
			var storeid = $("#storeselect").val();
			if(storeid==-1||storeid==null){
				return;
			};
			$.ajax({
				type:"get",
				url:"/ldss/store/alluserinfo",
				data:{
					storeid:storeid
				},
				async:false,
				dataType:"json",
				success: function (data) {
					if(data.success){
						var data = data.data;
						$("#managers").empty();
						for(var i = 0; i < data.length; i++){
							$("#managers").append(
								"<tr>"+
								"<td>"+data[i].username+"</td>"+
								"<td>"+data[i].usertel+"</td>"+
								"<td>"+data[i].userIDcard+"</td>"+
								"<td>"+data[i].storename+"</td>"+
								"<td>"+data[i].userpost+"</td>"+
								"<td>"+ 
								/* "<button type='button' class='btn btn-danger manager' name='"+data.id+"'>"+"修改"+"</button>"+ */
								"</td>"+
								"</tr>"
								);
						}
					}
					else{
						alert(data.message);
					}
				}
			})
		}
	</script>
</body>
</html>